package com.grsu.phonestation.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "SUBSCRIBE")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public class Subscribe {

	@Id
	@GeneratedValue
	@Column(name = "ID")
	private int id;
	
	@ManyToOne
	@JoinColumn(name = "USERID", insertable = true, updatable = true, nullable = true)
	private User user;
	
	@ManyToOne
	@JoinColumn(name = "SERVICEID", insertable = true, updatable = true, nullable = true)
	private Service service;
	
	@Column(name = "DATEACTIVATION")
	private Date dateActivation;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Service getService() {
		return service;
	}

	public void setService(Service service) {
		this.service = service;
	}

	public Date getDateActivation() {
		return dateActivation;
	}

	public void setDateActivation(Date dateActivation) {
		this.dateActivation = dateActivation;
	}

}
